package homework;

import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        System.out.println("输入字符串");
        String s =new Scanner(System.in).nextLine();
        int count1=0;
        int count2=0;
        for (int i = 0; i < s.toCharArray().length; i++) {
            if (s.toCharArray()[i]>='0'&&s.toCharArray()[i]<='9'){
                count1++;
            }else if (s.toCharArray()[i]>='a'&&s.toCharArray()[i]<='z'){
                count2++;
            }else if (s.toCharArray()[i]>='A'&&s.toCharArray()[i]<='Z'){
                count2++;
            }
        }
        System.out.println("数字有："+count1);
        System.out.println("英文字母有："+count2);
    }
}
